﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 桥接模式
{
    /// <summary>
    /// 手机品牌 抽象类， 聚合（关联）手机软件类，，而不是继承手机软件类
    /// </summary>
    abstract class HandsetBrand
    {
        protected HandsetSoft soft;
        public void SetSoft(HandsetSoft soft)
        {
            this.soft = soft;
        }
        public abstract void Runer();
    }

    class HandsetBrandA : HandsetBrand
    {
        public override void Runer()
        {
            soft.Run();
        }
    }
    class HandsetBrandB : HandsetBrand
    {
        public override void Runer()
        {
            soft.Run();
        }
    }
}
